package com.ssyt.ssh.sys.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.ssyt.ssh.common.BaseDao;
import com.ssyt.ssh.sys.dao.ArticleDao;
import com.ssyt.ssh.sys.entity.Article;

@Repository
public class ArticleDaoImpl extends BaseDao<Article, Integer> implements
		ArticleDao {

	@Override
	public List<Article> listTitle() {
		String str = "SELECT * FROM article ORDER BY read_times DESC";
		return listEntityBySql(str);
	}

	@Override
	public List<Article> listOne(Integer id) {
		String str = "SELECT * FROM article WHERE user_id=? ORDER BY read_times DESC";
		return listEntityBySql(str, id);
	}

	@Override
	public List<Article> listArticle() {
		String str = "SELECT * FROM article";
		return listEntityBySql(str);
	}

}
